import java.util.Scanner;
public class Main3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int q = in.nextInt();
        long[] num = new long[n];
        long sum = 0L;
        for (int i = 0; i < n; i++) {
            num[i] = in.nextInt();
            sum += num[i];
        }
        int j;
        while (q-- > 0) {
            j = in.nextInt();//代表第 j 个元素不动，其他翻倍。
            for (int i = 0; i < n; i++) {
                if (i != j - 1) {
                    sum += num[i];
                    num[i] += num[i];
                }
            }
        }

        System.out.println(sum % (1000000000 + 7));
    }
}
